<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/1/6
  Time: 14:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="${pageContext.request.contextPath}/css/common.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="wrap">
    <!-- main begin-->
    <div class="sale">
        <h1 class="lf">在线拍卖系统</h1>
        <div class="logout left">欢迎您：${sessionScope.login.userId} </div>
        <div class="logout left">欢迎您：${sessionScope.login.userName} </div>
        <div class="logout right"><a href="${pageContext.request.contextPath}/user/exit" title="注销">注销</a></div>
    </div>
    <form action="${pageContext.request.contextPath}/auction/showAuction" class="forms">
        <label for="name">名称</label>
        <input name="auction.auctionName" type="text" class="nwinput" id="name"/>
        <label for="names">描述</label>
        <input name="auction.auctionDesc" type="text" id="names" class="nwinput"/>
        <label for="time">开始时间</label>
        <input name="auction.auctionStartTime" type="date" id="time" class="nwinput"/>
        <label for="end-time">结束时间</label>
        <input name="auction.auctionEndTime" type="date" id="end-time" class="nwinput" />
        <label for="price">起拍价</label>
        <input name="auction.auctionStartPrice" type="text" id="price" class="nwinput" />
        <input name="" type="submit"  value="查询" class="spbg buttombg f14  sale-buttom"/>
        <c:if test="${sessionScope.login.userIsadmin==1}">
            <a href="${pageContext.request.contextPath}/auction/addAuction.jsp"><input type="button"  value="发布" class="spbg buttombg f14  sale-buttom buttomb"/></a>
        </c:if>
    </form>
    <div class="items">
        <ul class="rows even strong">
            <li>名称</li>
            <li class="list-wd">描述</li>
            <li>开始时间</li>
            <li>结束时间</li>
            <li>起拍价</li>
            <li class="borderno">操作</li>
        </ul>
        <c:forEach var="a" items="${list}">
            <ul class="rows">
                <li><a href="#" title="">${a.auctionName}</a></li>
                <li class="list-wd">${a.auctionDesc}</li>
                <li><fmt:formatDate value="${a.auctionStartTime}" pattern="yyyy-MM-dd hh-mm-ss"/></li>
                <li><fmt:formatDate value="${a.auctionEndTime}" pattern="yyyy-MM-dd hh-mm-ss"/></li>
                <li>${a.auctionStartPrice}</li>
                <c:if test="${sessionScope.login.userIsadmin==0}">
                    <li class="borderno red"><a href="${pageContext.request.contextPath}/auction/selectAuction?auction.auctionId=${a.auctionId}">竞拍</a></li>
                </c:if>
                <c:if test="${sessionScope.login.userIsadmin==1}">
                    <li class="borderno red">
                        <a href="${pageContext.request.contextPath}/auction/getOneAuction?auction.auctionId=${a.auctionId}" title="竞拍" >修改</a>|
                        <a href="${pageContext.request.contextPath}/auction/removeAuction?auction.auctionId=${a.auctionId}" title="竞拍" >删除</a>
                    </li>
                </c:if>
            </ul>
        </c:forEach>
        <div class="page">
            <c:if test="${pageNum>1}">
                <a href="${pageContext.request.contextPath}/auction/showAuction?pageNum=1" title="">首页</a>
                <a href="${pageContext.request.contextPath}/auction/showAuction?pageNum=${pageNum-1}" title="">上一页</a>
            </c:if>
            <span>当前是第${pageNum}页,总共${totalPage}页</span>
            <c:if test="${pageNum<totalPage}">
                <a href="${pageContext.request.contextPath}/auction/showAuction?pageNum=${pageNum+1}" title="">下一页</a>
                <a href="${pageContext.request.contextPath}/auction/showAuction?pageNum=${totalPage}" title="">尾页</a>
            </c:if>
        </div>
    </div>
    <!-- main end-->
</div>
</body>
</html>

